Automatically retry HTTP requests returning 5xx
authorAlex Crichton <alex@alexcrichton.com>
Thu, 11 May 2017 19:41:13 +0000 (12:41 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Thu, 11 May 2017 19:41:13 +0000 (12:41 -0700)
commit6155653653acd073c9888b2da73b9661d52e55aa
treebb94faf6d642a1048da2dcb10fc16671d3a848e3
parent58fe1a8d655b78f2224faec641aa97fcb6a72eb0
Automatically retry HTTP requests returning 5xx

This commit implements auto-retry for downloading crates from crates.io whenever
a 5xx response is returned. This should help assist with automatic retries
whenever Cargo attempts to download directly from S3 but S3 returns a 500 error,
which is defined as "please retry again".

This logic may be a little eager to retry *all* 500 errors, but there's a
maximum cap on all retries regardless, so hopefully it doesn't result in too
many problems.

Closes #3962
src/cargo/sources/registry/remote.rs
src/cargo/util/errors.rs